<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>${sysName}</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="stylesheet" href="${resRoot}/layui/css/layui.css" media="all" />
	<link rel="stylesheet" href="${resRoot}/css/main.css" media="all" />
	<link rel="stylesheet" href="${resRoot}/layui/admin/admin.css" media="all" />
</head>
<body class="childrenBody">
	<div class="layui-fluid">   
          <div class="layui-card">
	<div class="layui-form layui-card-header layuiadmin-card-header-auto">
	<form id="searchForm" class="layui-form layui-form-pane" method="post" action=""  >
		<div class="layui-inline">
		    <a class="layui-btn search_btn">查询</a>
		</div>
		<div class="layui-inline">
			<a class="layui-btn linksAdd_btn" style="background-color:#5FB878" href="javascript:void(0);" onclick="addData();">添加</a>
			<a class="layui-btn linksAdd_btn" href="javascript:void(0);" onclick="exportExcel();">导出</a>
		</div>
		</form>
	<div class="layui-form member_list">
	  	<table class="layui-table">
		    <colgroup>
				<col>
				<col>
				<col>
				<col>
				<col>
		    </colgroup>
		    <thead>
				<tr>
					<th>序号</th>
					<th>商户id</th>
					<th>卡号</th>
					<th>会员id</th>
					<th>姓名</th>
					<th>性别</th>
					<th>生日</th>
					<th>邮箱</th>
					<th>电话</th>
					<!--   <th>等级</th> -->
					<!--   <th>积分</th> -->
					<!--   <th>绑定时间</th> -->
					<!--   <th>来源</th> -->
					<!--   <th>是否绑定</th> -->
					<!--   <th>状态</th> -->
					<!--   <th>会员数据</th> -->
					<!--   <th>其他系统id</th> -->
					<!--   <th>详情</th> -->
					<!--   <th>头像</th> -->
					<th>创建时间</th>
					<th>操作</th>
				</tr>
		    </thead>
		    <tbody>
		    	<#list result.datas as data>
		    	<tr>
					<td>${(result.pageNumber - 1)*result.pageSize + data_index+1}</td>
					<td><#if data.bussinessId??>${data.bussinessId! }</#if></td>
					<td><#if data.cardNo??>${data.cardNo! }</#if></td>
					<td><#if data.memberId??>${data.memberId! }</#if></td>
					<td><#if data.name??>${data.name! }</#if></td>
					<td><#if data.sex??>${data.sex! }</#if></td>
					<td><#if data.birthday??>${data.birthday! }</#if></td>
					<td><#if data.email??>${data.email! }</#if></td>
					<td><#if data.tel??>${data.tel! }</#if></td>
					<!--  <td><#if data.level??>${data.level! }</#if></td>-->
					<!--  <td><#if data.point??>${data.point?string('#.##') }</#if></td>-->
					<!--  <td><#if data.bindTime??>${data.bindTime?datetime}</#if></td>-->
					<!--  <td><#if data.source??>${data.source! }</#if></td>-->
					<!--  <td><#if data.isBind??>${data.isBind! }</#if></td>-->
					<!--  <td><#if data.state??>${data.state! }</#if></td>-->
					<!--  <td><#if data.memberData??>${data.memberData! }</#if></td>-->
					<!--  <td><#if data.otherSysId??>${data.otherSysId! }</#if></td>-->
					<!--  <td><#if data.intro??>${data.intro! }</#if></td>-->
					<!--  <td><#if data.headPicUrl??>${data.headPicUrl! }</#if></td>-->
					<td>${data.createTime?datetime}</td>
					<td><a class="layui-btn layui-btn-normal layui-btn-xs" href="javascript:void(0);" onclick="addData('${data.id}');" ><i class="iconfont icon-edit"></i>修改</a>
					<a class="layui-btn layui-btn-normal layui-btn-xs" href="javascript:void(0);" onclick="showDetial('${data.id}');" ><i class="iconfont"></i>详情</a> 
		        		<a class="layui-btn layui-btn-danger layui-btn-xs" href="javascript:void(0);" onclick="del('${data.id}');" ><i class="layui-icon"></i>删除</a>
		        	</td>
				</tr>
				</#list>
			</tbody>
		</table>
	</div>
	<div id="page"></div>
	</div>
	</div></div>
	<script type="text/javascript" src="${resRoot}/layui/layui.js"></script>
	<script src="${resRoot}/js/jquery.min.js?v=2.1.4"></script>
	<script src="${resRoot}/layui/layui.all.js" charset="utf-8"></script>
	<#assign pageUrl=base+'/sys/memberCardDTO/show?'>
	<#include "/page/page1.html">
	<script>
	
	function exportExcel() {
		var index = layer.msg('加载中...',{icon: 16,time:false,shade:0.8});
		$("#searchForm").attr("action","${base}/sys/memberCardDTO/export");
		$("#searchForm").submit();
		
		layer.close(index);
	}
	$(".search_btn").click(function(){ 
		  window.location.href="${base}/sys/memberCardDTO/show";
	  });
	
	  		function del(id){	
	  			layer.confirm('确定删除该条数据吗?', function(index){
  				 $.ajax({
  		    		 type : "post",
  		    		 url : "${base}/sys/memberCardDTO/del",
  		    		 data : {
  		    			  id : id
  		    			 },
  					 dataType : "json",
  					 async : false,
  					 success : function(data) {
  						 flag  = data.message;
  							if(flag != 0) {
  								layer.msg('删除成功！', {
  									  icon: 1,
  									  time: 2000 //2秒关闭（如果不配置，默认是3秒）
  									}, function(){
  									  //do something
  										window.location.reload();
  									});  

  								
  							} else {
  								layer.alert("数据错误，请完善数据！");
  							}
  					 }
  		    	 });
  			});
		}
	  		function addData(id){
	  			var url = "${base}/sys/memberCardDTO/input";
	  			var titleStr = "添加";
	  			if(id){
	  				url = url + "?id=" + id;
	  				titleStr = "修改";
	  			}
	  	        var index = layui.layer.open({
	  	            title : titleStr,
	  	            type : 2,
	  	            content : url,
	  	            success : function(layero, index){
	  	                var body = layui.layer.getChildFrame('body', index);
	  	                setTimeout(function(){
	  	                    layui.layer.tips('点击此处返回', '.layui-layer-setwin .layui-layer-close', {
	  	                        tips: 3
	  	                    });
	  	                },500)
	  	            }
	  	        })
	  	        layui.layer.full(index);
	  	        //改变窗口大小时，重置弹窗的宽高，防止超出可视区域（如F12调出debug的操作）
	  	        $(window).on("resize",function(){
	  	            layui.layer.full(index);
	  	        })
	  	    }
	  		
	  		
	  		function showDetial(id){
	  			var url = "${base}/sys/memberCardDTO/detial";
	  			var titleStr = "详情";
	  			if(id){
	  				url = url + "?id=" + id;
	  			}
	  	        var index = layui.layer.open({
	  	            title : titleStr,
	  	            type : 2,
	  	            content : url,
	  	            success : function(layero, index){
	  	                var body = layui.layer.getChildFrame('body', index);
	  	                setTimeout(function(){
	  	                    layui.layer.tips('点击此处返回', '.layui-layer-setwin .layui-layer-close', {
	  	                        tips: 3
	  	                    });
	  	                },500)
	  	            }
	  	        })
	  	        layui.layer.full(index);
	  	        //改变窗口大小时，重置弹窗的宽高，防止超出可视区域（如F12调出debug的操作）
	  	        $(window).on("resize",function(){
	  	            layui.layer.full(index);
	  	        })
	  	    }
	  		

</script>
</body>
</html>